home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 42 / 042.d81 / file verifier (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  111 lines

  1. 1 clr:dim f$(150),ft(150),fs(150)
  2. 5 poke53280,12:poke53281,12
  3. 8 print"[147][144]                                        [146]";
  4. 9 print"           loadstar presents            [146]";
  5. 10 print"                                        [146]";
  6. 11 print"             file verifier              [146]";
  7. 12 print"                                        [146]";
  8. 13 print"              by shawn ort      (c)1986  [146]";
  9. 14 print"                                       [146]";
  10. 15 print"notes:":print"+ = normal used track and sector"
  11. 16 print"+[144] = two or more files use the same block";
  12. 17 print"*[144] = disk error in file"
  13. 18 print"      insert disk with files to"
  14. 19 print"  verify and press space to continue"
  15. 20 print"   press return to exit to loadstar"
  16. 21 print"    hold down q to quit verifying"
  17. 22 geta$:ifa$=""then22
  18. 23 ifa$=chr$(13) then 30
  19. 25 ifa$=" "then 100
  20. 26 goto22
  21. 30 print"[145]     do you wish to quit? (y/n)     "
  22. 31 geta$:ifa$=""then31
  23. 32 ifa$="[217]"ora$="y"then40
  24. 33 ifa$="n"ora$="[206]"thenprint"[145][145]";:goto20
  25. 34 goto 31
  26. 40 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  27. 41 ifer<>63 then print"[147]":end
  28. 45 load"hello connect",8,1
  29. 100 :
  30. 102 print"reading the directory..."
  31. 103 print"please wait..."
  32. 105 open15,8,15,"i0":close15
  33. 110 open1,8,2,"$"
  34. 115 forx=1to250:get#1,a$:nextx
  35. 120 x=0
  36. 125 :
  37. 130 get#1,a$:a$=a$+chr$(0):ifasc(a$)=0then130
  38. 135 tf=asc(a$):tf=tf-128:if tf>4thenclose1:goto200
  39. 140 get#1,a$:a$=a$+chr$(0):t=asc(a$)
  40. 145 get#1,a$:a$=a$+chr$(0):s=asc(a$)
  41. 150 ft(x)=t:fs(x)=s:ff$=""
  42. 155 get#1,a$:a$=a$+chr$(0):ifa$<>chr$(0)thenff$=ff$+a$:goto155
  43. 160 f$(x)=ff$
  44. 165 forxx=0to8:get#1,a$:nextxx
  45. 170 x=x+1:goto130
  46. 200 :
  47. 205 gosub1000
  48. 210 forf=0tox-1
  49. 214 poke781,0:sys59903
  50. 215 print"file to verify:   ";f$(f)
  51. 216 print"blocks used: ";b;"     [q[144]]uit";
  52. 220 open15,8,15:open5,8,5,"#"
  53. 225 print#15,"u1:"5;0;ft(f);fs(f)
  54. 230 get#5,t$:t=asc(t$+chr$(0))
  55. 235 get#5,s$:s=asc(s$+chr$(0))
  56. 237 if t=0thent=ft(f):s=fs(f):gosub2000:goto280
  57. 238 tt=t:ss=s:t=ft(f):s=fs(f):gosub2000
  58. 239 t=tt:s=ss
  59. 240 goto 265
  60. 245 :
  61. 250 print#15,"u1:"5;0;t;s
  62. 251 ifpeek(203)=62thenf=x-1:goto280
  63. 252 tt=t:ss=s
  64. 255 get#5,t$:t=asc(t$+chr$(0))
  65. 260 get#5,s$:s=asc(s$+chr$(0))
  66. 265 input#15,a$:ifa$<>"00"then er=255:t=tt:s=ss:gosub2000:goto 280
  67. 270 if t=0 then goto 280
  68. 271 ift>35ors>20then er=255:t=tt:s=ss:gosub2000:goto 280
  69. 272 gosub2000
  70. 275 goto250
  71. 280 close5:close15:next f
  72. 285 poke781,0:sys59903
  73. 288 print"blocks used: ";b
  74. 290 print"done, press any key when ready."
  75. 295 geta$:ifa$=""then295
  76. 300 run
  77. 1000 print"[147]20                 ::::::::::::::::::"
  78. 1001 print"19                 ::::::::::::::::::"
  79. 1002 print"18                        :::::::::::"
  80. 1003 print"17                              :::::"
  81. 1004 print"16"
  82. 1005 print"15"
  83. 1006 print"14"
  84. 1007 print"13"
  85. 1008 print"12"
  86. 1009 print"11"
  87. 1010 print"10"
  88. 1011 print" 9"
  89. 1012 print" 8"
  90. 1013 print" 7"
  91. 1014 print" 6"
  92. 1015 print" 5"
  93. 1016 print" 4"
  94. 1017 print" 3"
  95. 1018 print" 2"
  96. 1019 print" 1"
  97. 1020 print" 0"
  98. 1021 print"  00000000011111111112222222222333333"
  99. 1022 print"  12345678901234567890123456789012345[144]";
  100. 1025 return
  101. 2000 :
  102. 2001 input#15,a$
  103. 2002 if t>35 or s>20 then poke53280,6:for rt=1to20:nextrt:poke53280,12:return
  104. 2003 b=b+1:a=43:c=0
  105. 2004 ifer=255thener=0:a=42:c=1:goto2005
  106. 2005 p=peek(1905+t+(s*-40))
  107. 2006 if p=42 or p=43 thena=43:c=1
  108. 2007 poke1905+t+(s*-40),a
  109. 2008 poke56177+t+(s*-40),c
  110. 2010 return
  111.